package com.mp.thread;

import com.mp.goods.bean.Standard;
import com.mp.goods.mapper.StandardMapper;

/**
 *  模拟并发情况，乐观锁的使用
 * @author:
 * @date:  2020年7月26日
 */
public class StandardThread implements Runnable{
    public  StandardMapper standardMapper;
    public  Standard standard;
    public String standardName;

    public StandardThread() {
    }

    public StandardThread(StandardMapper standardMapper,Standard standard,String standardName) {
        this.standardMapper=standardMapper;
        this.standard=standard;
        this.standardName=standardName;
    }

    public StandardMapper getStandardMapper() {
        return standardMapper;
    }

    public void setStandardMapper(StandardMapper standardMapper) {
        this.standardMapper = standardMapper;
    }


    @Override
    public void run() {
        standard.setStandardName(this.standardName);
        standardMapper.updateById(standard);
    }




}
